package cn.com.dcsgo;

import java.util.Random;

/**
 * 随机音节数生成器
 *
 * @author Dcsgo
 * @since 2025/2/17 14:30
 */

public class RandomSyllableNumberMaker {
    private static final Random random = new Random();

    public static int getRandomSyllableNumber() {
        return random.nextInt(Syllable.MAX_SYLLABLE_NUMBER) + 1;
    }

    public static int[] getRandomSyllableNumber(int quantity) {
        if (quantity < 0) {
            throw new IllegalArgumentException("quantity: " + quantity + "小于0");
        }
        int[] result = new int[quantity];
        for (int i = 0; i < quantity; i++) {
            result[i] = getRandomSyllableNumber();
        }
        return result;
    }
}
